package com.sang.fegin;

import com.sang.fegin.fallback.UserFeignApiFallBack;
import com.sang.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

//远程调用这个UserFeignApiFallBack类中的 降级方法
@FeignClient(value = "user-service", fallback = UserFeignApiFallBack.class)
public interface UserFeignApi {

    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") String username);

}